#!/user/bin/env set PYTHONIOENCODING=utf-8 && python -u
# -*- coding: utf-8 -*-

import time

class Threads:

    @staticmethod
    def await_uninterruptibly(times=0, secs=1, condition=None):
        for i in range(times):
            if condition is None or condition(i):
                return True
            else:
                time.sleep(secs)
        return False
